package jmine.tec.executionlog.domain;

import bancosys.tec.persist.builders.AbstractDBBuilder;

public class ExecutionLogItemBuilder extends AbstractDBBuilder<ExecutionLogItem> {

    private ExecutionLogItem bean = createBean();

    @Override
    protected ExecutionLogItem doBuild() {
        ExecutionLogItem result = createBean();
        result.setContent(bean.getContent());
        result.setMessage(bean.getMessage());
        result.setStackTrace(bean.getStackTrace());
        result.setExecutionLog(bean.getExecutionLog());
        return result;
    }

    public static ExecutionLogItemBuilder anExecutionLogItem() {
        return new ExecutionLogItemBuilder();
    }

    public ExecutionLogItemBuilder content(String value) {
        bean.setContent(value);
        return this;
    }

    public ExecutionLogItemBuilder message(String value) {
        bean.setMessage(value);
        return this;
    }

    public ExecutionLogItemBuilder stackTrace(String value) {
        bean.setStackTrace(value);
        return this;
    }

    public ExecutionLogItemBuilder executionLog(ExecutionLog value) {
        bean.setExecutionLog(value);
        return this;
    }

    public ExecutionLogItemBuilder saveTimes(int times) {
        for (int i = 0; i < times; i++) {
            this.save();
        }
        return this;
    }

}
